Skip to content

PR 3: purge legacy pi 0.67 wiring from cua-cli - #24

Merged
rgarcia merged 2 commits into
mainfrom
hypeship/cua-cli-purge-legacy
Jun 12, 2026
Merged

PR 3: purge legacy pi 0.67 wiring from cua-cli#24
rgarcia merged 2 commits into
mainfrom
hypeship/cua-cli-purge-legacy

Conversation

@rgarcia

@rgarcia rgarcia commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Third PR of the cua-cli → CuaAgentHarness migration (see
docs/cua-cli-harness-migration.md, PR 3).
PR 1 wired the non-interactive surface onto the harness; PR 2 rebuilt the
interactive TUI on it. With every CLI surface now on the new wiring, this PR
deletes the pre-harness pi-0.67 code path and drops the deprecated packages
from packages/cua-cli/package.json.

Deleted source files

All replaced by the harness equivalents already merged in PRs 1 and 2:

  • src/agent.ts (pi 0.67 Agent assembly)
  • src/agent-prompt.ts (replaced by harness.prompt(text, { images }) plus
    the screenshot helper in action/harness-runner.ts)
  • src/models.ts (replaced by src/harness-models.ts over the cua-ai catalog)
  • src/config.ts (TOML config; replaced by env-var auth + --thinking)
  • src/sessions.ts (legacy SessionManager glue; replaced by
    src/harness-sessions.ts over JsonlSessionRepo)
  • src/skills.ts (legacy pi-coding-agent skill loader; replaced by
    src/harness-skills.ts)
  • src/named-sessions.ts (legacy cua-translator.browserSession.open glue;
    replaced by src/harness-named-sessions.ts over @onkernel/sdk)
  • src/action/runner.ts (legacy pi 0.67 action runner; replaced by
    src/action/harness-runner.ts)
  • src/output/jsonl.ts (legacy jsonl sink; replaced by
    src/output/harness-jsonl.ts)

Dropped dependencies

From packages/cua-cli/package.json:

  • @mariozechner/pi-agent-core, @mariozechner/pi-ai,
    @mariozechner/pi-coding-agent, @mariozechner/pi-tui
  • @onkernel/cua-translator, @onkernel/cua-openai,
    @onkernel/cua-anthropic, @onkernel/cua-gemini,
    @onkernel/cua-tzafon, @onkernel/cua-yutori
  • smol-toml

Also removed the matching references entries from
packages/cua-cli/tsconfig.json. The provider packages remain in the
monorepo until PR 4 deletes them.

CLI surface changes

  • Removed the cua config init|show subcommand and the --config-profile
    flag. Configuration is now environment variables only (cua-ai key
    conventions + KERNEL_API_KEY + <PROVIDER>_BASE_URL).
  • Updated --help text to drop config refs, refresh the env-var table, and
    list recommended provider:model refs explicitly.
  • Removed the now-dead configProfile plumbing through
    StartNamedSessionOptions and NamedSessionMetadata. New named-session
    metadata files will no longer include config_profile; existing files
    parse fine (the field is unused).
  • Updated the package description and rewrote packages/cua-cli/README.md
    to reflect env-var auth, provider:model refs, and the removed cua config
    subcommand.

Test plan

  • npm run build — full monorepo build green
  • npm test --workspace @onkernel/cua-cli — 33/33 tests pass
  • npm test --workspace @onkernel/cua-ai — 88/88 tests pass
  • npm test --workspace @onkernel/cua-agent -- --exclude '**/*.live.test.ts'
    28/28 tests pass
  • npm ls --workspace @onkernel/cua-cli shows no @mariozechner/*,
    @onkernel/cua-{translator,openai,anthropic,gemini,tzafon,yutori}, or
    smol-toml entries (acceptance criterion from the plan)

Out of scope (PR 4)

  • Deleting the packages/cua-{translator,openai,anthropic,gemini,tzafon,yutori}
    workspaces themselves and the root package.json / tsconfig.json /
    README.md references to them.
  • npm deprecate of published provider packages (manual follow-up).

Note

Medium Risk
Breaking change for users who relied on TOML profiles and bare model ids without provider: prefixes; runtime behavior should match harness paths already shipped in PRs 1–2.

Overview
PR 3 removes the legacy pi 0.67 / per-provider wiring from @onkernel/cua-cli now that all surfaces run through CuaAgentHarness (PRs 1–2).

Deleted code: agent.ts, agent-prompt.ts, models.ts, config.ts, sessions.ts, skills.ts, named-sessions.ts, action/runner.ts, and output/jsonl.ts — each superseded by harness-* / cli-harness modules.

Dependencies: package.json now depends only on @earendil-works/pi-coding-agent, @earendil-works/pi-tui, @onkernel/cua-agent, @onkernel/cua-ai, and @onkernel/sdk. Removed @mariozechner/pi-*, all @onkernel/cua-{translator,openai,anthropic,gemini,tzafon,yutori}, and smol-toml. tsconfig.json project references to those provider packages are dropped.

User-facing: cua config init|show and --config-profile are gone; auth and base URLs are environment variables only. Help and READMEs document provider:model refs (e.g. openai:gpt-5.5) and --thinking. Named-session metadata no longer writes config_profile (old files still parse).

Docs: Root and packages/cua-cli/README.md quickstart drops cua config init in favor of env vars.

Reviewed by Cursor Bugbot for commit d9aa32c. Bugbot is set up for automated code reviews on this repo. Configure here.

Delete the dead pre-harness source files (agent.ts, agent-prompt.ts,
old models.ts, config.ts, old sessions.ts, skills.ts, old named-sessions.ts,
old action/runner.ts, old output/jsonl.ts) now that the harness paths from
PR 1 and PR 2 cover every CLI surface. Drop @mariozechner/*, the
@onkernel/cua-{translator,openai,anthropic,gemini,tzafon,yutori} provider
packages, and smol-toml from packages/cua-cli/package.json so npm ls on
cua-cli no longer mentions any of them.

Remove the --config-profile flag, the cua config init|show subcommand, and
the now-dead configProfile plumbing through StartNamedSessionOptions /
NamedSessionMetadata. Update HELP, the cua-cli README (env-var auth, no
TOML config, provider:model refs), and the package description to match.
Drop the deleted-package tsconfig references from packages/cua-cli/tsconfig.json.

Acceptance per docs/cua-cli-harness-migration.md PR 3: npm ls cua-cli has
no removed packages; full monorepo build + cua-cli vitest suite are green.

@rgarcia rgarcia left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — PR 3 (legacy purge)

Verified independently on the branch:

  • Full monorepo build green (npm run build, with the zig 0.15.2 toolchain installed the same way the cli-unit CI job does).
  • npm test --workspace @onkernel/cua-cli → 33/33 (7 files, incl. the 4 ptywright TUI scenarios, PTYWRIGHT_REQUIRED=1).
  • npm test --workspace @onkernel/cua-ai → 88/88; npm test --workspace @onkernel/cua-agent -- --exclude '**/*.live.test.ts' → 28/28.
  • Acceptance criterion: npm ls --workspace @onkernel/cua-cli shows none of @mariozechner/*, @onkernel/cua-{translator,openai,anthropic,gemini,tzafon,yutori}, smol-toml. smol-toml is gone from the lockfile entirely; @mariozechner/pi-{ai,agent-core} remain in the lock only as optional peers of the deprecated provider workspaces, which PR 4 deletes.
  • npm ci --dry-run clean; GitHub CI green (integration/agent-e2e skipped because the PR is draft — expected per the workflow condition).
  • No remaining imports of any deleted module and no references to the dropped packages anywhere under packages/cua-cli; no edits under packages/agent or packages/ai.

Plan adherence: matches the migration doc's PR 3 section. The deviations beyond the literal file list — dropping the dead config_profile/configProfile plumbing in harness-named-sessions.ts, two stale doc comments, and the tsconfig.json references cleanup — all fall under the plan's "any now-dead code" clause. Old named-session metadata files still parse (readNamedSession is a plain JSON.parse; the extra field is ignored, and since the parsed object is re-serialized whole by recordTranscriptPath, an old file's config_profile even survives rewrites). Behavioral contracts (action exit codes, jsonl schema incl. schema_version, session flags, named-session lifecycle) are untouched by this diff and covered by the existing suites.

Findings

  1. minor — root README.md quickstart (~line 113–114) still documents cua config init ("# either set up a config file…"). With this PR merged, that invocation no longer hits a subcommand: the positionals fall through to interactive mode and start a TUI run with the prompt "config init". The plan's PR 3 bullet ("update … README (… removed cua config)") arguably covers this line even though the root README workspace table/diagram are PR 4 scope. Cheap fix: drop those two quickstart lines in this PR; otherwise make sure PR 4 picks them up (the quickstart's bare-id model examples, e.g. --model claude-opus-4-7, could move to provider:model refs in the same pass — they still resolve while unambiguous, so that part is cosmetic).
  2. nit.agents/skills/update-models/reference/{discover-models,native-action-probe}.ts still read ~/.config/cua/config.toml as a Yutori-key fallback. Standalone reference scripts, nothing breaks; flagging so PR 4's "references under docs/ and skills/" sweep doesn't miss them (they live under .agents/skills/, not skills/).

No blockers or majors — approving as-is; finding 1 is fine to fold into PR 4 if preferred.

The subcommand was removed in this PR; the documented command would now
fall through to interactive mode and start a TUI run with the literal
prompt "config init".
@rgarcia

rgarcia commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Addressed:

  • Finding 1 (root README quickstart cua config init): dropped those two lines in d9aa32c. Bare-id model examples left alone as noted (cosmetic, still resolve unambiguously).
  • Finding 2 (.agents/skills/update-models/reference/{discover-models,native-action-probe}.ts): deferred to PR 4 along with the rest of the workspace-wide sweep, as suggested. Will include .agents/skills/ explicitly in that pass.

@rgarcia
rgarcia marked this pull request as ready for review June 12, 2026 05:45
@firetiger-agent

Copy link
Copy Markdown

Firetiger deploy monitoring skipped

This PR didn't match the auto-monitor filter configured on your GitHub connection:

PRs in the kernel, infra, hypeman, and hypeship repos. kernel is a ~mono repo with many logical services underneath, ensure to focus on the implicated service for the PR

Reason: PR is for cua-cli package in the monorepo, which is not explicitly listed in the filter (kernel, infra, hypeman, hypeship repos); unclear if this service falls under the kernel mono-repo scope intended by the operator.

To monitor this PR anyway, reply with @firetiger monitor this.

@rgarcia
rgarcia merged commit 7a5b61d into main Jun 12, 2026
6 checks passed
@rgarcia
rgarcia deleted the hypeship/cua-cli-purge-legacy branch June 12, 2026 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant